package com.pantuo.sys.controller;

import com.pantuo.common.utils.TableRequest;
import com.pantuo.common.vo.JsonResult;
import com.pantuo.sys.service.LineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/line")
public class LineController {

    @Autowired
    private LineService lineService;

    @RequestMapping("/doFindPageObjects")
    public PageImpl<Object> doFindPageObjects(TableRequest request) {
        return lineService.findPageObjects(request);
    }

    @RequestMapping("/doFindAllNames")
    public JsonResult findAllNames(Integer id) {
        return new JsonResult(lineService.findAllNames(id));
    }

    //根据公司id查线路名称
    @RequestMapping("/doFindLineByCName")
    public JsonResult findLineByCName(Integer id) {
        return new JsonResult(lineService.findLineByCName(id));
    }

    @RequestMapping("/doLineRangeSelect")
    public JsonResult doLineRangeSelect(TableRequest request) {
        return new JsonResult(lineService.lineRangeSelect(request));
    }
}
